package com.meilingcloud.biobank.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 出入库单据与样本复份关联 对象 bank_stock_samples
 *
 * @author chenl
 * @date 2021-03-15
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("bank_stock_samples")
public class StockSamples implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 出入库单据ID
     */
    private String stockId;

    /**
     * 样本复份ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampBackupId;

    /**
     * 样本ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampId;

    /**
     * 样本源ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampSourceId;

    /**
     * 样本源类型ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampSourceTypeId;

    /**
     * 样本类型ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampTypeId;

    /**
     * 样本组ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampGroupId;

    /**
     * 样本复份编号
     */
    private String sampBackupCode;

    /**
     * 样本量
     */
    private BigDecimal sampQuantity;

    /**
     * 样本单位
     */
    private String sampUnit;

    /**
     * 格式化位置
     */
    private String sampLocation;

    /**
     * 冻融次数
     */
    private Integer sampFreezeThawCount;

    /**
     * 采样时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date samplingTime;

    /**
     * 条码/二维码
     */
    private String qrCode;

    /**
     * 冻存管类型
     */
    private String tubeType;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 样本源名称
     */
    @TableField(exist = false)
    private String sampSourceName;

    /**
     * 样本类型名称
     */
    @TableField(exist = false)
    private String sampTypeName;

    /**
     * 样本组名称
     */
    @TableField(exist = false)
    private String sampGroupName;

    /**
     * 样本源类型名称
     */
    @TableField(exist = false)
    private String sampSourceTypeName;

    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();
}
